package com.hqq.behaviour.iterator;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * App
 * Created by heqianqian on 2017/6/17.
 */
public class App {

    private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) {
        TreasureChest treasureChest = new TreasureChest();

        ItemIterator itemIterator = treasureChest.itemIterator(ItemType.POTION);
        while (itemIterator.hasNext()) {
            LOGGER.info(itemIterator.next().toString());
        }

        LOGGER.info("--------------------");

        itemIterator = treasureChest.itemIterator(ItemType.RING);
        while (itemIterator.hasNext()) {
            LOGGER.info(itemIterator.next().toString());
        }

        LOGGER.info("--------------------");

        itemIterator = treasureChest.itemIterator(ItemType.WEAPON);
        while (itemIterator.hasNext()) {
            LOGGER.info(itemIterator.next().toString());
        }

        LOGGER.info("--------------------");

    }

}
